import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

@Component({
  selector: 'test-child',
  templateUrl: './child.component.html',
  styleUrls: ['./child.component.scss']
})
export class ChildComponent implements OnInit {

  private _childpaneltitle:string = "子组件标题";

  @Input()
  set childpaneltitle(title:string){
    this._childpaneltitle="【"+title+"】";
  }

  get childpaneltitle():string{
    return this._childpaneltitle;
  }

  @Output()
  public follow = new EventEmitter<string>();
  

  constructor() { }

  ngOnInit() {
  }
  public emitAnEvent():void{
    this.follow.emit("follow");
  }
  public childFn():void{
    alert("我是阿爸");
  }

}
